import Vue from 'vue'
import VueRouter from 'vue-router'


Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    redirect: '/table'
  },
  {
      path: '/',
      component: () => import(/* webpackChunkName: "home" */ '../components/common/Home.vue'),
      meta: { title: '' },
      children: [
          {
            path: '/table',
            component: () => import(/* webpackChunkName: "table" */ '../views/BaseTable.vue'),
            meta: { title: '基础表格' }
          },
          {
              path: '/icon',
              component: () => import(/* webpackChunkName: "icon" */ '../views/Icon.vue'),
              meta: { title: '自定义图标' }
          },
          {
              path: '/tabs',
              component: () => import(/* webpackChunkName: "tabs" */ '../views/Tabs.vue'),
              meta: { title: 'tab选项卡' }
          },
          {
              path: '/form',
              component: () => import(/* webpackChunkName: "form" */ '../views/BaseForm.vue'),
              meta: { title: '基本表单' }
          },
          {
              path: '/404',
              component: () => import(/* webpackChunkName: "404" */ '../views/404.vue'),
              meta: { title: '404' }
          }
      ]
  },
  {
      path: '/login',
      component: () => import(/* webpackChunkName: "login" */ '../views/Login.vue'),
      meta: { title: '登录' }
  },
  {
      path: '*',
      redirect: '/404'
  }
];

const router = new VueRouter({
  routes
})

export default router
